package o;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import com.huawei.appgallery.assistantdock.base.externalaction.openviewaction.OpenViewActionRegistry;
import com.huawei.appgallery.forum.base.api.IUserStateChange;
import com.huawei.appgallery.forum.base.api.IUserStateChange.d;
import com.huawei.appgallery.forum.base.card.ForumCardBean;
import com.huawei.appgallery.forum.cards.bean.ForumPostCardBean;
import com.huawei.appgallery.forum.section.api.ISectionDetailActivityProtocol;
import com.huawei.appgallery.forum.section.bean.ForumNoticeCardBean;
import com.huawei.appgallery.forum.section.bean.ForumSectionEnterCardBean;
import com.huawei.appgallery.forum.section.bean.ForumSectionHeadCardBean;
import com.huawei.appgallery.forum.section.buoy.action.OpenPostCommentAction;
import com.huawei.appgallery.forum.section.buoy.action.OpenPublishPostAction;
import com.huawei.appgallery.forum.section.buoy.action.OpenSectionDetailAction;
import com.huawei.appgallery.forum.section.buoy.action.OpenUserHomeAction;
import com.huawei.appgallery.forum.section.fragment.SectionLoadingFragment;
import com.huawei.appgallery.forum.section.node.BuoyForumNoticeNode;
import com.huawei.appgallery.forum.section.node.BuoyForumPostNode;
import com.huawei.appgallery.forum.section.node.BuoyTempForumPostNode;
import com.huawei.appgallery.forum.section.node.ForumNoticeNode;
import com.huawei.appgallery.forum.section.node.ForumSectionEnterNode;
import com.huawei.appgallery.forum.section.node.TempForumPostNode;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.gamebox.plugin.gameservice.bean.GameInfo;

public class caf extends fhy {

    static class b implements o.brg.e {
        private b() {
        }

        public void ˎ(Context context, BaseCardBean baseCardBean) {
            if (context == null || baseCardBean == null) {
                bqx.ॱ("SectionDefine", "null == context || !(bean instanceof BuoyBaseCardBean)");
                return;
            }
            dex o_caj = new caj(context);
            fae ˏ = ((faj) cdb.ॱ(faj.class)).ˏ();
            if (ˏ != null) {
                GameInfo gameInfo = ˏ.getGameInfo();
                Bundle bundle = new Bundle();
                bundle.putString("SEGMENT_URI", baseCardBean.ॱॱ());
                bundle.putString("APPID", TextUtils.isEmpty(baseCardBean.ͺˏ()) ? gameInfo.getAppId() : baseCardBean.ͺˏ());
                bundle.putString("DOMAIN_ID", bqy.ˋ().ˎ());
                ((faj) cdb.ॱ(faj.class)).ˏ(context, o_caj, bundle);
                return;
            }
            bqx.ॱ("SectionDefine", "buoyBridge == null");
        }
    }

    static class e implements o.brg.e {
        private e() {
        }

        public void ˎ(Context context, BaseCardBean baseCardBean) {
            fjb ˎ = fho.ˏ().ˋ("Section").ˎ("section_detail_activity");
            ISectionDetailActivityProtocol iSectionDetailActivityProtocol = (ISectionDetailActivityProtocol) ˎ.ˊ();
            iSectionDetailActivityProtocol.setUri(baseCardBean.ॱॱ());
            if (baseCardBean instanceof ForumCardBean) {
                iSectionDetailActivityProtocol.setDomainId(((ForumCardBean) baseCardBean).ॱ());
            }
            fiu.ˊ().ˏ(context, ˎ);
        }
    }

    public void ˏ() {
        cam.ˋ();
        brf o_brf = (brf) fho.ˏ().ˋ("Base").ॱ(brf.class);
        o_brf.ˋ("section_loading_title_.fragment", SectionLoadingFragment.class);
        o_brf.ॱ("forumtemppostcard", TempForumPostNode.class, can.class);
        o_brf.ॱ("buoyforumtemppostcard", BuoyTempForumPostNode.class, can.class);
        o_brf.ॱ("forumnoticecard", ForumNoticeNode.class, ForumNoticeCardBean.class);
        o_brf.ॱ("forumsectionentercard", ForumSectionEnterNode.class, ForumSectionEnterCardBean.class);
        cib.ˊ("forumsectionheadcard", ForumSectionHeadCardBean.class);
        cib.ˊ("buoyforumsectionheadcard", ForumSectionHeadCardBean.class);
        o_brf.ॱ("buoyforumnoticecard", BuoyForumNoticeNode.class, ForumNoticeCardBean.class);
        o_brf.ॱ("buoyforumpostcard", BuoyForumPostNode.class, ForumPostCardBean.class);
        brg o_brg = (brg) fho.ˏ().ˋ("Base").ॱ(brg.class);
        o_brg.ˊ("forum_detail", new e());
        o_brg.ˏ("forum_detail", new b());
        IUserStateChange iUserStateChange = (IUserStateChange) fho.ˏ().ˋ("Base").ॱ(IUserStateChange.class);
        OpenViewActionRegistry.register(OpenPostCommentAction.ACTION, OpenPostCommentAction.class);
        OpenViewActionRegistry.register(OpenSectionDetailAction.ACTION, OpenSectionDetailAction.class);
        OpenViewActionRegistry.register(OpenPublishPostAction.ACTION_OPEN_FORUM_PUBLISH_POST, OpenPublishPostAction.class);
        OpenViewActionRegistry.register(OpenUserHomeAction.ACTION_OPEN_UESR_HOME, OpenUserHomeAction.class);
        iUserStateChange.ˊ("Section", new d(this) {
            final /* synthetic */ caf ॱ;

            {
                this.ॱ = r1;
            }

            public void ॱ(int i) {
                if (i != 0 && i == 1) {
                    cat.ˋ().ॱ();
                    car.ˏ().ˋ();
                }
            }
        });
    }
}
